<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>考试列表 - 智能教育系统</title>
    <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gradient-to-br from-blue-50 to-indigo-100 min-h-screen">
    <!-- 引入导航栏 -->
    <div th:replace="fragments/navbar :: navbar"></div>

    <div class="container mx-auto px-4 py-8">
        <div class="max-w-4xl mx-auto">
            <h2 class="text-2xl font-bold text-gray-800 mb-6">我的考试</h2>

            <!-- 消息提示 -->
            <div th:if="${success}" class="mb-4 p-4 bg-green-50 text-green-700 rounded-md">
                <p th:text="${success}">成功消息</p>
            </div>
            <div th:if="${error}" class="mb-4 p-4 bg-red-50 text-red-700 rounded-md">
                <p th:text="${error}">错误消息</p>
            </div>

            <!-- 考试列表 -->
            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                <div th:each="exam : ${exams}" 
                     class="bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow">
                    <h3 class="text-lg font-semibold text-gray-800 mb-2" th:text="${exam.examName}">考试名称</h3>
                    <div class="space-y-2 text-sm text-gray-600">
                        <p>
                            <span class="font-medium">科目：</span>
                            <span th:text="${exam.subject}">科目</span>
                        </p>
                        <p>
                            <span class="font-medium">考试日期：</span>
                            <span th:text="${#temporals.format(exam.examDate, 'yyyy-MM-dd')}">日期</span>
                        </p>
                        <p>
                            <span class="font-medium">班级：</span>
                            <span th:text="${exam.classEntity.className}">班级</span>
                        </p>
                    </div>
                    <div class="mt-4 flex justify-end space-x-2">
                        <a th:href="@{/exam-submit(examId=${exam.id})}" 
                           class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
                            提交试卷
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html> 